<%@page import="java.util.List"%>
<%@page import="java.sql.*"%>
<%@page import="org.barman.dao.OrderDAO"%>
<%@page import="org.barman.pojo.Order"%>

<%@include file="/layout/header.jspf"%>

<%
	OrderDAO orderDAO = new OrderDAO();
	List<Order> orderList = orderDAO.getAllByStatus("");

%>
<form action="../Order_changestatus?id=${id}" method="post">
<center>
	<br>
	<h1>Barman Main Page</h1>
	<div id="admin_main">
		<table BORDER="1">
			<TR>
				<TH>ID</TH>
				<TH>Status</TH>
				<TH>Waiter</TH>
				<TH>Created</TH>
				<TH>TAKE</TH>
			</TR>
			<%
				for (Order or : orderList) {
			%>
			<tr>
				<td>
					<%
						out.print(or.getId());
					%>
				</td>
				<td>
					<%
						out.print(or.getStatus().toString());
					%>
				</td>
				<td>
					<%
						out.print(or.getWaiter().getFirstName() + or.getWaiter().getLastName());
					%>
				</td>
				<td>
					<%
						out.print(or.getCreated());
					%>
				</td>
				<td>
					<%
						out.print("<a href=\""
									+ or.getId().toString() + "\">" + "Take</a>");
					%>
				</td>
			<tr>
				<%
					}
				%>
			
		</table>
		<br>
	</div>
</center>
</form>
<%@include file="/layout/footer.jspf"%>
